//
//  ZZBaseViewController.m
//  ZZLC
//
//  Created by 杨春至 on 2017/12/13.
//  Copyright © 2017年 ZhongZeng. All rights reserved.
//

#import "ZZBaseViewController.h"
#import "ZZWebViewController.h"
#import "ZZLCLoginVC.h"
#import "ZZBaseNavigationController.h"

@interface ZZBaseViewController ()

@end

@implementation ZZBaseViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    UIBarButtonItem *leftBarButtonItem = [[UIBarButtonItem alloc]initWithTitle:@""style:UIBarButtonItemStyleDone target:NULL action:NULL];
    self.navigationItem.backBarButtonItem = leftBarButtonItem;
    self.view.backgroundColor = [UIColor whiteColor];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
}
- (void)setupPhone:(NSString *)phoneNum{
    NSString *str2 = [[UIDevice currentDevice] systemVersion];
    if ([str2 compare:@"10.2" options:NSNumericSearch] == NSOrderedDescending || [str2 compare:@"10.2" options:NSNumericSearch] == NSOrderedSame){
        NSString* PhoneStr = [NSString stringWithFormat:@"telprompt://%@",phoneNum];
        if (@available(iOS 10.0, *)) {
            [[UIApplication sharedApplication] openURL:[NSURL URLWithString:PhoneStr] options:@{} completionHandler:^(BOOL success) {
                
            }];
        } else {
            // Fallback on earlier versions
        }
    }else{
        NSMutableString *str=[[NSMutableString alloc] initWithFormat:@"telprompt:%@",phoneNum];
        [[UIApplication sharedApplication] openURL:[NSURL URLWithString:str]];
    }
}
- (void)jumpToClause:(NSString *)clauseUrl{
    ZZWebViewController *webVC = [[ZZWebViewController alloc]init];
    webVC.url = clauseUrl;
    [self.navigationController pushViewController:webVC animated:YES];
    
}
- (void)jumpToLogVC{
    NSLog(@"%@",NSStringFromCGRect([UIApplication sharedApplication].keyWindow.frame));
    ZZLCLoginVC *loginVC = [[ZZLCLoginVC alloc]initWithNibName:@"ZZLCLoginVC" bundle:nil];
    ZZBaseNavigationController *naVC = [[ZZBaseNavigationController alloc]initWithRootViewController:loginVC];
    [self.navigationController presentViewController:naVC animated:YES completion:nil];

}
- (void)jumpToH5VCByURL:(NSString *)url{
    ZZWebViewController *webVC = [[ZZWebViewController alloc]init];
    webVC.url = url;
    [self.navigationController pushViewController:webVC animated:YES];
}
@end
